/*
 * UI.h
 *
 *  Created on: 2021��9��3��
 *      Author: ������
 */

#ifndef CODE_UI_H_
#define CODE_UI_H_

#define SHOW_INIT   	oled_init
#define SHOW(X,Y,Z) 	oled_p6x8str(X,Y,Z)
#define SHOW_CLEAR(X) oled_fill(X)


//*******************************
extern unsigned char flag_task;

//=============================��̨============================
#define PIT_TIME  10
extern double meicix;
extern double meiciy;

extern int move_stop_flagyaw;
extern int move_stop_flagpitch;
extern int cloud_state;
extern int cloud_time;
extern int cloud_flag;
extern int pause_flag;

extern float renwusanj8_yaw;
extern float renwusanj8_pitch;

extern float j8renwusi_yaw;
extern float j8renwusi_pitch;
extern double weifenyaw;
extern double weifenpitch;
extern int renwusi_stop;
extern int renwusi_zhongzhi;

extern float goal_dutyyaw;
extern float goal_dutypitch;


extern int zuobiao[5][2];
extern int task3[5][2];

extern char select_point;
extern double ceshi;
extern float float_yaw_duty;
extern float float_pitch_duty;
extern short int rect_point[4][2];
extern unsigned char jieshou_flag;
extern short int jieshou_count;
extern short int jieshoushuzu[150];
//-------------------------------UI-----------------------------------
extern char buf[30];
extern unsigned char config_flag;
extern unsigned short time_10ms;
extern unsigned char time_100ms;
extern unsigned char BI_100ms;

//--------------------------��Ҫ����������----------------------------
/**************************����������������************************************/
extern unsigned int knob_count;
extern float vbat;
extern short int object_x;//V831���ص�������������
extern short int object_y;//V831���ص�������������


/**************************����������������*************************************/
/***************************PID���************************************/
extern int spwm; 					 //���ٶȻ��ó���pwmֵ
extern int16 tpwm; 					 //��ת�򻷵ó���pwmֵ



extern struct PID speed;
extern struct PID turn;
/***************************PID���************************************/

/*********************����ٶ����************************************/


extern int cloud_yaw_duty;	//�����̨ƫ����
extern int cloud_pitch_duty;//�����̨������

extern int dx; //v831上可以加一下近似处理
extern int dy;
extern int last_dx;
extern int last_dy;
extern double yaw_p;
extern double yaw_d;
extern double pitch_p;
extern double pitch_d;
extern double task4_yaw; //运动控制yaw,需要定义初始值来给出第一个点要打的位置
extern double task4_pitch;//控制pitch


/***********************����ٶ����************************************/

/*********���������*******************/
extern short int z_zero_drift;

//extern double ax;
//extern double ay;
//extern double az;
extern double vz;
//extern double vy ;
extern double Yaw;
/************���������******************/


/*****************��־λ*********************/
extern unsigned char run_flag;
extern unsigned char bi_flag;
/*****************��־λ*********************/
extern void Adjust_Parameter_UI(void);
extern void Flag_UI(void);
extern void Main_UI(void);
extern void Motor_Test(void);
void apply_point(void);

#endif /* CODE_UI_H_ */









